package sma.fbss.model;

import java.util.ArrayList;
import java.util.Map;

import sma.fbss.database.Database;

public class MDPurchase {
	public String club_seller = "";
	public String club_buyer;
	public String footballer;
	public String description;
	public float price;

	public MDPurchase() {
	}

	public MDPurchase(String sl, String by, String fb, float pr, String des) {
		club_seller = sl;
		club_buyer = by;
		footballer = fb;
		this.price = pr;
		description = des;
	}

	public void setPurchase() {
		try {
			Database database = new Database("FBMarket");
			String str_sql = "insert into PURCHASE(club_buyer, club_seller, footballeur," +
			"price, description) values('" + this.club_buyer + "','" + 
			this.club_seller + "','" + this.footballer + "'," + price + ",'" + 
			this.description + "')";
			database.set(str_sql);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


}
